package com.xinqing.test.LetCode;

import java.util.HashSet;

/**
 * @Author:CHQ
 * @Date:2021/7/20 16:29
 * @Description
 */
public class Intersection {
    public static void main(String args[]){
        HashSet<Integer> set=new HashSet<>();
        int[] nums1={1,2,2,1};
        int[] nums2={2,3};

        for(int x:nums1){
            set.add(x);
        }

        for(int y:nums2){
            if(!set.add(y)){
                System.out.print(y+" ");
            }
        }
    }
}
